<%@include file="/WEB-INF/pages/commons/commons.jsp"%>

<jsecurity:hasPermission name="profile:changePassword:*">
<script type="text/javascript">
    $(document).ready(function() {
        $("#closeChangePasswordSpace").click(function(){
            $("#changePasswordSpace").fadeOut();
            $("#changePasswordSpace").hide();
            return false;
        });

        $("#changePassword").click(function() {
            $("#changePasswordSpace").html("<fmt:message key='global.loading'/>");
            var form = this.form;
            var param = $(form).serializeArray();
            $.post(
                    '<stripes:url beanclass="foo.bar.blog.web.action.registered.ProfileActionBean" event="changePassword"/>',
                    param,
                    function(data) {
                        $("#changePasswordSpace").hide();
                        $("#changePasswordSpace").html(data);
                        $("#changePasswordSpace").fadeIn();
                    }
              );
            $("#changePasswordSpace").fadeIn();
            return false;
        });

        $("#changePasswordSpace").hide();
    });
</script>

    <h2>Change Password</h2>
    <stripes:messages />
    <stripes:errors globalErrorsOnly="true"/>

    <stripes:form beanclass="foo.bar.blog.web.action.registered.ProfileActionBean">

        <a id="closeChangePasswordSpace" href=""><fmt:message key="profile.jsp.close"/></a>
        <stripes:errors globalErrorsOnly="false"/>
        <table width="100%">
        <tr>
            <td><stripes:label for="password"/></td>
            <td><stripes:password name="password" /></td>
        </tr>
        <tr>
            <td><stripes:label for="confirmPassword"/></td>
            <td><stripes:password name="confirmPassword" /></td>
        </tr>
        <tr>
            <td colspan="2"><stripes:submit id="changePassword" name="changePassword"><fmt:message key="profile.jsp.submit"/></stripes:submit></td>
        </tr>
        </table>
        <br/>
        <br/>
    </stripes:form>
</jsecurity:hasPermission>


